import request from '@/api/useRequest'
const publicPath = '/users'
//登入接口
export function login(data: { username: string; password: string }) {
  return request({
    url: `${publicPath}/login`,
    method: 'post',
    data,
    useCommonTip:true
  } as any)
}
//
export function getUserInfo(){
  return  request({
    url:`${publicPath}/profile`,
    method:'get'
  } as any)
}
//更新接口
export function apis(data:any ){
  return request({
    url:`${publicPath}/changePassInfo`,
    method:'put',
    data,
    useCommonTip:true
  }as any)
}
//注册接口
export function regist (data:{
   username:string,
    password:string,
    code:string
  }){
    return request({
      url:`${publicPath}/register`,
      method:'post',
      data
    })
}